home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / process.cls < prev    next >
Text File  |  1997-06-14  |  1KB  |  62 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "CProcess"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Option Explicit
  11.  
  12. Public Enum EErrorProcess
  13.     eeBaseProcess = 13150   ' CProcess
  14. End Enum
  15.  
  16. #If Win32 Then
  17. Private idProcess As Long           ' This process
  18. Private sExePath As String
  19. #End If
  20.  
  21. Sub Create(idProcessA As Long, sExePathA As String)
  22.     idProcess = idProcessA
  23.     sExePath = sExePathA
  24. End Sub
  25.  
  26. Property Get ID() As Long
  27.     ID = idProcess
  28. End Property
  29.  
  30. Property Get ExePath() As String
  31.     ExePath = sExePath
  32. End Property
  33.  
  34. Property Get ExeFile() As String
  35.     ExeFile = MUtility.GetFileBaseExt(sExePath)
  36. End Property
  37.  
  38. Property Get ExeName() As String
  39.     ExeName = MUtility.GetFileBase(sExePath)
  40. End Property
  41.  
  42. #If fComponent = 0 Then
  43. Private Sub ErrRaise(e As Long)
  44.     Dim sText As String, sSource As String
  45.     If e > 1000 Then
  46.         sSource = App.ExeName & ".Process"
  47.         Select Case e
  48.         Case eeBaseProcess
  49.             BugAssert True
  50.        ' Case ee...
  51.        '     Add additional errors
  52.         End Select
  53.         Err.Raise COMError(e), sSource, sText
  54.     Else
  55.         ' Raise standard Visual Basic error
  56.         sSource = App.ExeName & ".VBError"
  57.         Err.Raise e, sSource
  58.     End If
  59. End Sub
  60. #End If
  61.  
  62.